package com.gexiaobao.pigeon.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.gexiaobao.pigeon.R
import com.gexiaobao.pigeon.app.base.DataBindBaseViewHolder
import com.gexiaobao.pigeon.app.model.bean.Item
import com.gexiaobao.pigeon.app.model.bean.ItemBean
import com.gexiaobao.pigeon.app.util.ImageLoaderManager
import com.gexiaobao.pigeon.databinding.ItemAuctionPigeonListBinding
import com.gexiaobao.pigeon.databinding.ItemFollowAuctionPigeonsBinding
import com.makeramen.roundedimageview.RoundedImageView

/**
 * @Author      : hxw
 * @Date        : 2024/11/12 14:38
 * @Describe    :
 */
class AdapterFollowAuctionPigeons(data: ArrayList<ItemBean>) :
    BaseQuickAdapter<ItemBean, DataBindBaseViewHolder>(R.layout.item_follow_auction_pigeons, data) {

    override fun convert(holder: DataBindBaseViewHolder, item: ItemBean) {
        val binding = DataBindBaseViewHolder.getBinding(holder) as ItemFollowAuctionPigeonsBinding
        binding.data = item
        binding.executePendingBindings()//防止列表抖动

        val imagePigeon = holder.getView<RoundedImageView>(R.id.imagePigeon)
        ImageLoaderManager.loadRoundImageTopOrEmpty(context, item.img, imagePigeon, 6, R.mipmap.app_icon_)
    }
}